<cfsilent>
	<cfset entry = event.getArg("entry") />
	<cfset comments = entry.getComments() />
	<cfset categories = entry.getCategories() />
	<cfset trackbacks = entry.getTrackbacks() />
	<cfset categoryNames = "" />
	<cfset categoryIds = "" />
	
	<cfloop index="i" from="1" to="#ArrayLen(categories)#" step="1">
		<cfset categoryIds = ListAppend(categoryIds, categories[i][1], ",") />
		<cfset categoryNames = ListAppend(categoryNames, categories[i][2], ",") />
	</cfloop>
</cfsilent>

<cfoutput>
	<div class="post">
		<div class="header">
			<h3>#entry.getTitle()#</h3>
			<div class="date">
				#getProperty("resourceBundleService").getLocaleUtils().i18nDateFormat(entry.getDtPosted(), 1)#
			</div>
		</div>
		<div class="content">
			#getProperty("udfs").renderEntry(entry.getBody())#
			
			<cfif entry.getMoreBody() NEQ "">
				<p>#getProperty("udfs").renderEntry(entry.getMoreBody())#</p>
			</cfif>
			
			<cfif entry.getPhoto() NEQ "">
				<img src="#getProperty('blogUrl')#/uploads/photos/#URLEncodedFormat(GetFileFromPath(entry.getPhoto()))#" />
			</cfif>
		</div>			
		<div class="footer">
			<ul>
				<cfif entry.getAllowComments() AND getProperty("allowComments")>
					<li class="comments">
						<a href="javascript:doPopup('index.cfm?#getProperty('eventParameter')#=showComments&entryId=#entry.getEntryId()#', 600, 600, false);">
							<cfif comments.RecordCount EQ 1>
								#getProperty("resourceBundleService").getResourceBundle().getResource("comment")#
							<cfelse>
								#getProperty("resourceBundleService").getResourceBundle().getResource("comments")#
							</cfif>
							(#comments.RecordCount#) 
						</a>
					</li>
				</cfif>
				
				<cfif entry.getAllowTrackbacks() AND getProperty("allowTrackbacks")>
					<li class="trackbacks">
						<a href="javascript:doPopup('index.cfm?#getProperty('eventParameter')#=showTrackbacks&entryId=#entry.getEntryId()#', 600, 600, false);">
							<cfif trackbacks.RecordCount EQ 1>
								#getProperty("resourceBundleService").getResourceBundle().getResource("trackback")#
							<cfelse>
								#getProperty("resourceBundleService").getResourceBundle().getResource("trackbacks")#
							</cfif>
							(#trackbacks.RecordCount#)
						</a>
					</li>
				</cfif>
				
				<cfif entry.getEnclosure() NEQ "">
					<li class="enclosures">
						<a href="#getProperty('blogUrl')#/uploads/enclosures/#URLEncodedFormat(GetFileFromPath(entry.getEnclosure()))#">
							#getProperty("resourceBundleService").getResourceBundle().getResource("downloadenclosure")#
						</a>&nbsp;(#entry.getEnclosureMimeType()# <cfif entry.getEnclosureSize() / 1000 LT 1000>#NumberFormat(entry.getEnclosureSize() / 1000, "999")# KB<cfelse>#NumberFormat(entry.getEnclosureSize() / 1000000, "999.99")# MB</cfif>)
					</li>
				</cfif>
				
				<li class="categories">
					<cfif ListLen(categoryNames) GT 0>
						<cfloop index="i" from="1" to="#ListLen(categoryNames)#">
							<a href="index.cfm?#getProperty('eventParameter')#=showEntriesByCategory&categoryId=#ListGetAt(categoryIds, i)#&categoryName=#URLEncodedFormat(listGetAt(categoryNames, i))#">
								#ListGetAt(categoryNames, i)#</a><cfif i LT ListLen(categoryNames)>, </cfif>
						</cfloop>
					<cfelse>
						(#getProperty("resourceBundleService").getResourceBundle().getResource("uncategorized")#)
					</cfif>
				</li>
				
				<cfif getProperty("allowSendToFriend")>
					<li class="sendtofriend">
						<a href="index.cfm?#getProperty('eventParameter')#=showSendEntryToFriend&entryId=#entry.getEntryId()#">
							#getProperty("resourceBundleService").getResourceBundle().getResource("send")#
						</a>
					</li>
				</cfif>
			</ul>
			<div class="postmetadata">
				#getProperty("resourceBundleService").getResourceBundle().getResource("posted")# 
				#getProperty("resourceBundleService").getLocaleUtils().i18nDateFormat(entry.getDtPosted(), 3)# 
				@ #getProperty("resourceBundleService").getLocaleUtils().i18nTimeFormat(entry.getDtPosted(), 3)# 
				#getProperty("resourceBundleService").getResourceBundle().getResource("by")# #entry.getAudit().getCreatedByName()#
			</div>
		</div>
	</div>
	
	<!--- Output any comments for this post --->
	<cfif comments.RecordCount GT 0>
		<h3>#getProperty("resourceBundleService").getResourceBundle().getResource("comments")#</h3>
		<div id="comments">
			<cfloop query="comments">
				<cfif is_active>
					<cfif currentRow mod 2 eq 0>
						<cfset commentClass="evencomment">
					<cfelse>
						<cfset commentClass="oddcomment">
					</cfif>
					<div class="#commentClass#">
						#comment#
						<div class="commentmetadata">
							#getProperty("resourceBundleService").getResourceBundle().getResource("postedby")# 
							<cfif url NEQ ""><a href="#url#"></cfif>#name#<cfif url NEQ ""></a></cfif> 
							@ #getProperty("resourceBundleService").getLocaleUtils().i18nDateTimeFormat(dt_created, 3, 3)#
						</div>
					</div>
				</cfif>
			</cfloop>
		</div>
	</cfif>
	
</cfoutput>
